home *** CD-ROM | disk | FTP | other *** search
- ------------------------------------------------------------------------
- | |
- | |
- | |
- | |
- | |
- | |
- | |
- | |
- | |
- | |
- | |
- | |
- | |
- | |
- | |
- | |
- | |
- | |
- | |
- | |
- | |
- | |
- | G 3 2 0 4 0 0 |
- | |
- | Version 1.0 |
- | |
- | Copyright (C) 1994, Geoff Friesen B.Sc. |
- | All rights reserved. |
- | |
- | |
- | |
- | |
- | |
- | |
- | |
- | |
- | |
- | |
- | |
- | |
- | |
- | |
- | |
- | |
- | |
- | |
- | |
- | |
- | |
- | |
- ------------------------------------------------------------------------
-
- ------------------------------------------------------------------------
- | |
- | G320400 |
- | ------- |
- | |
- | G320400 is a graphics library that supports the VGA 320x400 graphics |
- | mode with 256 simultaneous colors. |
- | |
- | The following files make up this package. |
- | |
- | G320400.DOC - the documentation that you are currently reading |
- | G320400.H - a header containing useful constants and prototypes |
- | G320400.LIB - the large memory model implementation of the library |
- | MAC2G34.EXE - Macintosh PIC to G320400 G34 file converter |
- | PCX2G34.EXE - PCX to G320400 G34 file converter |
- | VIEWG34.EXE - G34 file viewer |
- | COWBOY.G34 - sample G34 file |
- | G320400.C - library source code |
- | MAC2G34.C - Macintosh file converter source code |
- | PCX2G34.C - PCX file converter source code |
- | VIEWG34.C - G34 file viewer source code |
- | VIEWG34.PRJ - G34 file viewer project file |
- | |
- | Borland C++ v3.1 was used to develop this package. |
- | |
- | G320400 supports two screen pages for graphics output. The current |
- | page used for output is known as the active page. The current visi- |
- | ble page is known as the visual page. The active page and the visi- |
- | ble page can be the same page. |
- | |
- | The following functions are part of the library. |
- | |
- | * word g_AndRect (word x, word y, char *buf); |
- | |
- | Perform a bitwise AND of the active page whose upper-left corner is |
- | specified by (x,y) with the memory array pointed to by buf. OK is |
- | returned if successful. ERROR is returned if the library has not |
- | been installed or the arguments are out of range. |
- | |
- | * word g_Circle (word x, word y, word r); |
- | |
- | Draw a circle on the active page whose center is positioned at (x,y) |
- | and having radius r. OK is returned if successful. If the library |
- | has not been installed then ERROR is returned. |
- | |
- | * word g_Cls (word color); |
- | |
- | Clear the active page using color. OK is returned if successful or |
- | ERROR if the library has not been installed. |
- | |
- | |
- ------------------------------------------------------------------------
- - 2 -
-
- ------------------------------------------------------------------------
- | |
- | * word g_CopyRect (word x, word y, char *buf); |
- | |
- | Copy the contents of buf to the active page. The upper-left corner |
- | of the resulting rectangle is specified by (x,y). OK is returned if |
- | successful. ERROR is returned if the library has not been installed |
- | or the arguments are out of range. |
- | |
- | * word g_DeInit (void); |
- | |
- | Deinitialize the library. OK is returned if successful. ERROR is |
- | returned if the library has not been installed. |
- | |
- | * word g_Error (void); |
- | |
- | Return a number that identifies the most recent error. A list of |
- | error constants are contained in G320400.H. |
- | |
- | * word g_GetAPage (word *pageno); |
- | |
- | Obtain the active page number. This number (0 or 1) is returned via |
- | *pageno. OK is returned if successful. ERROR is returned if the |
- | library has not been installed. |
- | |
- | * word g_GetColor (word *_fcolor, word *_bcolor); |
- | |
- | Obtain the current foreground and background colors used in render- |
- | ing images. The foreground color is returned via *_fcolor and the |
- | background color via *_bcolor. OK is returned if successful. ERROR |
- | is returned if the library has not been installed. |
- | |
- | * word g_GetLineStyle (dword *_style); |
- | |
- | Obtain the style used in drawing lines. This style is returned via |
- | *_style. OK is returned if successful. ERROR is returned if the |
- | library has not been installed. |
- | |
- | * word g_GetLineWidth (word *_width); |
- | |
- | Obtain the line width. This width is returned via *_width. OK is |
- | returned if successful. ERROR is returned if the library has not |
- | been installed. |
- | |
- | * word g_GetPalette (word index, word *r, word *g, word *b); |
- | |
- | Get the red, green, and blue components of the color entry found at |
- | index in the palette. Return the red component via *r, green via *g |
- | and blue via *b. Index must range from 0-255. OK is returned if |
- | successful. ERROR is returned if library not installed or bad index |
- | |
- ------------------------------------------------------------------------
- - 3 -
-
- ------------------------------------------------------------------------
- | |
- | * word g_GetPixel (word x, word y, word *color); |
- | |
- | Get the pixel color of the pixel at location (x,y) on the active |
- | page. The color is returned via *color. OK is returned if success- |
- | ful. ERROR is returned if the library has not been installed or the |
- | arguments are out of range. |
- | |
- | * word g_GetRect (word x1, word y1, word x2, word y2, char *buf); |
- | |
- | Get the contents of the rectangle on the active page whose upper- |
- | left corner is located at (x1,y1) and lower-right corner at (x2,y2). |
- | The contents are stored in buf which must be capable of storing at |
- | least 4+(x2-x1+1)*(y2-y1+1) bytes. OK is returned if successful. |
- | ERROR is returned if the library has not been installed or the argu- |
- | ments are out of range. |
- | |
- | * word g_GetVPage (word *pageno); |
- | |
- | Obtain the visual page number. This number (0 or 1) is returned via |
- | *pageno. OK is returned if successful. ERROR is returned if the |
- | library has not been installed. |
- | |
- | * word g_Init (void); |
- | |
- | Initialize the library. The screen is set to the 320x400x256 graph- |
- | ics mode. The background color is set to BLACK and the foreground |
- | color to LIGHTGRAY. The line style is set to SOLID and the width to |
- | 1. The current drawing position is set to (160,200). The active |
- | and visual pages are set to 0. OK is returned if successful. ERROR |
- | is returned if the library has not been installed or a VGA video |
- | card is not present. |
- | |
- | * word g_LineTo (word x, word y); |
- | |
- | Draw a line from the current drawing position to (x,y) on the active |
- | page. OK is returned if successful. ERROR is returned if the lib- |
- | rary has not been installed or the arguments are out of range. |
- | |
- | * word g_LoadG34 (char *filespec, char *buf); |
- | |
- | Load a G34 file into memory pointed to by buf. If a file extension |
- | is not specified then .G34 is assumed. Buf must be large enough to |
- | hold the file. OK is returned if successful. ERROR is returned if |
- | the library has not been installed, the file cannot be opened or |
- | accessed, or the file is corrupt. |
- | |
- | |
- | |
- | |
- ------------------------------------------------------------------------
- - 4 -
-
- ------------------------------------------------------------------------
- | |
- | * word g_MoveTo (word x, word y); |
- | |
- | Set the current drawing position to (x,y). OK is returned if suc- |
- | cessful. ERROR is returned if the library has not been installed or |
- | the arguments are out of range. |
- | |
- | * word g_Rectangle (word x1, word y1, word x2, word y2); |
- | |
- | Draw a rectangle on the active page with upper-left corner at |
- | (x1,y1) and lower-right corner at (x2,y2). OK is returned if suc- |
- | cessful. ERROR is returned is the library has not been installed or |
- | the arguments are out of range. |
- | |
- | * word g_SaveG34 (char *filespec, char *buf); |
- | |
- | Save the image pointed to by buf to a G34 file. The name of this |
- | file is specified by filespec. OK is returned if successful. ERROR |
- | is returned if the library has not been installed, buf points to |
- | corrupt memory, the file could not be created, or the file could not |
- | be written to. |
- | |
- | * word g_SetAPage (word pageno); |
- | |
- | Set the active page to pageno (0 or 1). OK is returned if success- |
- | ful. ERROR is returned if the library has not been installed. |
- | |
- | * word g_SetColor (word _fcolor, word _bcolor); |
- | |
- | Set the foreground and background rendering colors to _fcolor and |
- | _bcolor respectively. OK is returned if successful. If the library |
- | has not been installed then ERROR is returned. |
- | |
- | * word g_SetLineStyle (dword _style); |
- | |
- | Set the line drawing style to _style. See G320400.H for a list of |
- | useful style constants. OK is returned if successful. If the lib- |
- | rary has not been installed then ERROR is returned. |
- | |
- | * word g_SetLineWidth (word _width); |
- | |
- | Set the line width to _width. OK is returned if successful. ERROR |
- | is returned if the library has not been installed. |
- | |
- | * word g_SetPalette (word index, word r, word g, word b); |
- | |
- | Set the red, green, and blue components of the color entry found at |
- | index in the palette. Index must range from 0-255. OK is returned |
- | if successful. ERROR is returned if library not installed/bad index |
- | |
- ------------------------------------------------------------------------
- - 5 -
-
- ------------------------------------------------------------------------
- | |
- | * word g_SetPixel (word x, word y); |
- | |
- | Set the pixel at location (x,y) on the active page. OK is returned |
- | if successful. ERROR is returned if the arguments are out of range. |
- | |
- | * word g_SetVPage (word pageno); |
- | |
- | Set the visual page to pageno (0 or 1). OK is returned if success- |
- | ful. ERROR is returned if the library has not been installed. |
- | |
- | * word g_WriteChr (word chr); |
- | |
- | Draw a character on the active page whose ASCII code is contained in |
- | chr (0-255). The upper-left corner of this character is at the cur- |
- | rent drawing position. OK is returned if successful. ERROR is |
- | returned if the library has not been installed. |
- | |
- | * word g_WriteStr (const char *str); |
- | |
- | Draw a string on the active page. This function calls g_WriteChr(). |
- | OK is returned if successful. ERROR is returned if the library has |
- | not been installed. |
- | |
- | * word g_XorRect (word x, word y, char *buf); |
- | |
- | Perform a bitwise XOR of the active page whose upper-left corner is |
- | specified by (x,y) with the memory array pointed to by buf. OK is |
- | returned if successful. ERROR is returned if the library has not |
- | been installed or the arguments are out of range. |
- | |
- | MAC2G34 is a utility program for converting MacPaint images to G34 |
- | format. These are black and white images that have fixed dimensions |
- | of 576 horizontal by 720 vertical pixels. The syntax of the command |
- | line is: |
- | |
- | mac2g34 filespec [x y nx ny] |
- | |
- | You can specify an offset into the file which is the upper-left cor- |
- | ner. You can also specify the size of the file which gives you the |
- | ability to crop an image as appropriate. |
- | |
- | PCX2G34 is a utility program for converting PCX images to G34 for- |
- | mat. You can convert 2-color (monochrome), 8-color, 16-color, or |
- | 256-color images. The syntax of the command line is identical to |
- | MAC2G34. You can specify an offset into the file for the upper-left |
- | corner. You can also specify a size for cropping. However, the PCX |
- | format allows you to having images with varying sizes, not one size |
- | as found in MACPAINT image files. |
- | |
- ------------------------------------------------------------------------
- - 6 -
-
- ------------------------------------------------------------------------
- | |
- | VIEWG34 is a utility program for viewing G34 files. The command |
- | line syntax is: |
- | |
- | viewg34 filespec |
- | |
- | where filespec is a G34 file. |
- | |
- | G320400 is a shareware program however I am not asking for a regis- |
- | tration fee. I hope you enjoy using G320400. |
- | |
- | |
- | |
- | |
- | |
- | |
- | |
- | |
- | |
- | |
- | |
- | |
- | |
- | |
- | |
- | |
- | |
- | |
- | |
- | |
- | |
- | |
- | |
- | |
- | |
- | |
- | |
- | |
- | |
- | |
- | |
- | |
- | |
- | |
- | |
- | |
- | |
- | |
- | |
- | |
- ------------------------------------------------------------------------
- - 7 -
-